// 字符计数功能
document.addEventListener('DOMContentLoaded', function() {
    const textarea = document.getElementById('reportReason');
    const charCount = document.getElementById('charCount');

    if (textarea && charCount) {
        textarea.addEventListener('input', function() {
            const count = this.value.length;
            charCount.textContent = `${count}/500`;

            // 接近最大长度时显示警告
            if (count > 450) {
                charCount.style.color = '#ff4d4f';
            } else {
                charCount.style.color = '#888';
            }
        });
    }
});